package com.mew.slots.core.game.klxg;

import com.alibaba.fastjson.JSON;
import com.mew.common.entity.game.WinFree;
import com.mew.common.rest.bo.GameSession;
import com.mew.slots.core.common.handler.AbstractBetHandler;
import com.mew.slots.core.common.handler.SlotsHandler;
import com.mew.slots.core.common.messge.response.SlotsBonusPlayResponseMessage;
import com.mew.slots.core.common.messge.response.SlotsPlayResponseMessage;
import com.mew.slots.core.common.utils.SlotsGameUtil;
import com.mew.slots.core.common.vo.StrategyGameVO;
import com.mew.slots.core.game.klxg.bo.KlxgInRoom;
import com.mew.slots.core.game.klxg.message.KlxgResponseMessage;
import com.mew.slots.core.game.klxg.roller.KlxgIli;
import com.mew.slots.core.game.klxg.roller.KlxgXml;
import com.mew.slots.core.game.klxg.service.KlxgService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Author King.Song
 * @Date 2020/11/9 0009
 **/
@Service
@SlotsHandler(value = "KLXG")
@Slf4j
public class KlxgHandler extends AbstractBetHandler {
    private KlxgService service=new KlxgService();

    @Override
    public void specialCheck(StrategyGameVO gameVO, GameSession userVO) {
    }

    @Override
    public SlotsPlayResponseMessage play(StrategyGameVO gameVO, GameSession userVO) {
        return service.Ready(gameVO);
    }

    @Override
    public SlotsBonusPlayResponseMessage playBonus(StrategyGameVO gameVO, GameSession userVO) {
        return new SlotsBonusPlayResponseMessage();
    }

    @Override
    public void readRoller() throws Exception {
        KlxgIli.getInstance().init();
    }

    public static void main(String[] args) throws Exception {
        KlxgHandler handler=new KlxgHandler();
        handler.readRoller();
        StrategyGameVO vo = SlotsGameUtil.buildTestStrategyGameVO();
        vo.setLineNumber(50);
        vo.setControlType(2);
        SlotsPlayResponseMessage play = handler.play(vo, null);
        System.out.println(play);
    }
}
